!function (t) {
    function i(s) {
        if (e[s]) return e[s].exports;
        var n = e[s] = {
            exports: {},
            id: s,
            loaded: !1
        };
        return t[s].call(n.exports, n, n.exports, i), n.loaded = !0, n.exports
    }
    var e = {};
    return i.m = t, i.c = e, i.p = "./", i(0)
}([function (t, i, e) {
    e(1),e(2),e(3)
},  function (t, i) {
    Vue.component("pop-bind-bank-component", {
        template:'<div class="pop-panel" v-bind:class="{\'show\':this.show}"><div class="pop-box" style="width:800px;"><div class="pop-title">{{title}}<a class="win_close_btn" @click="close()"><i class="fa fa-fw fa-close"></i></a></div><div class="pop-content"><validator name="validatorMethod"><form role="form"><div class="box-body"><div style="overflow:hidden;"><div class="form-group" style="float:left;width:49%"><label for="bank_name">签约银行</label><select id="bank_name" @invalid="requiredInvalid(\'请选择一个签约银行\')" detect-change="off" detect-blur="off" initial="off" v-validate:bank_name="[\'required\']" v-bind:value="organizationBank.bank_name" v-model="organizationBank.bank_name" class="form-control" style="padding:0px;"><option v-for="bank in banks" value="{{bank}}">{{bank}}</option></select></div><div class="form-group" style="float:left;width:2%"></div><div class="form-group" style="float:left;width:49%"><label for="bank_no">银行账号</label><input type="text" id="bank_no" @invalid="requiredInvalid(\'请填写银行账号\')" detect-change="off" detect-blur="off" initial="off" v-validate:bank_no="[\'required\']" v-bind:value="organizationBank.bank_no" v-model="organizationBank.bank_no" class="form-control"></div></div><div style="overflow:hidden;"><div class="form-group" style="float:left;width:49%"><label for="province">开户省份</label><select id="province" @invalid="requiredInvalid(\'请选择一个开户省份\')" detect-change="off" detect-blur="off" initial="off" v-validate:province="[\'required\']" v-bind:value="organizationBank.province" v-model="organizationBank.province" class="form-control" style="padding:0px;"></select></div><div class="form-group" style="float:left;width:2%"></div><div class="form-group" style="float:left;width:49%"><label for="city">开户城市</label><select id="city" @invalid="requiredInvalid(\'请选择一个开户城市\')" detect-change="off" detect-blur="off" initial="off" v-validate:city="[\'required\']" v-bind:value="organizationBank.city" v-model="organizationBank.city" class="form-control" style="padding:0px;"></select></div></div><div class="form-group"><label for="bank_address">开户支行</label><input type="text" id="bank_address" @invalid="requiredInvalid(\'请填写开户支行\')" detect-change="off" detect-blur="off" initial="off" v-validate:bank_address="[\'required\']" v-bind:value="organizationBank.bank_address" v-model="organizationBank.bank_address" class="form-control"></div><div class="form-group"><label for="cardholder">开户名称</label><input type="text" id="cardholder" @invalid="requiredInvalid(\'请填写开户名称\')" detect-change="off" detect-blur="off" initial="off" v-validate:cardholder="[\'required\']" v-bind:value="organizationBank.cardholder" v-model="organizationBank.cardholder" class="form-control"></div><div class="form-group"><label for="identity">身份证号</label><input type="text" id="identity" v-bind:value="organizationBank.identity" v-model="organizationBank.identity" class="form-control"></div><div class="form-group"><label for="mobile_phone">银行预留手机号</label><input type="text" id="mobile_phone" v-bind:value="organizationBank.mobile_phone" v-model="organizationBank.mobile_phone" class="form-control"></div><div class="form-group" v-if="type==1 || type==3"><label for="money">金额（元）</label><input type="number" min="0" id="money" @invalid="requiredInvalid(\'请填写入金金额\')" detect-change="off" detect-blur="off" initial="off" v-validate:money="{required:true,min:1}" v-bind:value="organizationBank.money" v-model="organizationBank.money" class="form-control NumDecText"></div><div style="color:#ff0000;">{{info}}</div></div><div class="box-footer"><button type="button" class="btn btn-info btn-sm" style="width:120px;float:left;" @click="recharge()" v-if="type==1">入金</button><button type="button" class="btn btn-info btn-sm" style="width:120px;float:left;" @click="save()" v-if="type==2">保存</button><button type="button" class="btn btn-info btn-sm" style="width:120px;float:left;" @click="withdrawals()" v-if="type==3">出金</button><button type="button" class="btn  btn-default btn-sm" style="width:120px;float:left;margin-left:15px;" @click="close()">取消</button></div></form></validator></div></div><div class="bg"></div></div>',
        data: function () {
            return {
                show: !1,
                title:'提示窗口',
                showError:null,
                type:1,
                info:"",
                organizationBank: {
                    id:0,
                    bank_name:'',
                    bank_no:'',
                    province:'',
                    city:'',
                    bank_address:'',
                    cardholder:'',
                    identity:'',
                    mobile_phone:'',
                },
                banks:["工商银行","农业银行","招商银行","建设银行","邮政储蓄","华夏银行","光大银行","中信银行","民生银行","交通银行","浦发银行","广发银行"]
            }
        },
        events: {
            openWin: function (t) {
                $(".NumDecText").keyup(function(){
                    $(this).val($(this).val().replace(/[^0-9.]/g,''));
                }).bind("paste",function(){  //CTR+V事件处理
                    $(this).val($(this).val().replace(/[^0-9.]/g,''));
                }).css("ime-mode", "disabled"); //CSS设置输入法不可用

                var i = this;
                i.data_init(t);
                areaSelect.createSelect("province", "city");
                if (this.organizationBank.province != "") {
                    $("#province").val(this.organizationBank.province).change();
                }
                if (this.organizationBank.city != "") {
                    $("#city").val(this.organizationBank.city);
                }
            }
        },
        methods: {
            data_init: function (t) {
                this.title = t.title, this.type = t.type, this.info = t.info, this.organizationBank = t.organizationBank, this.showError = [], this.show = !0;
            },
            requiredInvalid:function (msg) {
                var t = this;
                t.showError.push(msg);
            },
            save: function() {
                var t = this;
                t.$validate(true,function () {
                    if(!t.$validatorMethod.invalid) {
                        // var city_arr = areaSelect.returnTextByCode("130200", 2);
                        var index = layer.load(0, {shade:[0.3, '#000000']}); //0代表加载的风格，支持0-2
                        postMsg(root+"/organization/bind_bank", t.organizationBank, function(i) {
                            layer.close(index);
                            layer.alert(i.msg);
                            if (i.code == 0) {
                                t.show = !1;
                                t.$dispatch("refreshCustomerInfo", {organizationBank:t.organizationBank});
                            }
                        });
                    } else {
                        layer.alert(t.showError[(t.showError.length-1)], {end:function () {
                            t.showError = [];
                        }});
                    }
                });
            },
            recharge: function () {
                var t = this;
                t.$validate(true,function () {
                    if(!t.$validatorMethod.invalid) {
                        // var city_arr = areaSelect.returnTextByCode("130200", 2);
                        var index = layer.load(0, {shade:[0.3, '#000000']}); //0代表加载的风格，支持0-2
                        postMsg(root+"/organization/recharge", t.organizationBank, function(i) {
                            layer.close(index);
                            layer.alert(i.msg);
                            if (i.code == 0) {
                                t.show = !1;
                                if (t.organizationBank.id == 0) {
                                    t.$dispatch("refreshOrganizationBankList");
                                } else {
                                    // t.$dispatch("refreshCustomerInfo", {customer:i.customer});
                                }
                            }
                        });
                    } else {
                        layer.alert(t.showError[(t.showError.length-1)], {end:function () {
                            t.showError = [];
                        }});
                    }
                });
            },
            withdrawals: function () {
                var t = this;
                t.$validate(true,function () {
                    if(!t.$validatorMethod.invalid) {
                        // var city_arr = areaSelect.returnTextByCode("130200", 2);
                        var index = layer.load(0, {shade:[0.3, '#000000']}); //0代表加载的风格，支持0-2
                        postMsg(root+"/organization/withdrawals", t.organizationBank, function(i) {
                            layer.close(index);
                            layer.alert(i.msg);
                            if (i.code == 0) {
                                t.show = !1;
                                t.$dispatch("refreshOrganizationBankList");
                            }
                        });
                    } else {
                        layer.alert(t.showError[(t.showError.length-1)], {end:function () {
                            t.showError = [];
                        }});
                    }
                });
            },
            close: function () {
                var t = this;
                t.show = !1;
            }
        }
    })
},  function (t, i) {
    Vue.component("pop-organization-recharge-component", {
        // <div class="form-group"><label for="bank_code">入金银行</label><select id="bank_code" @invalid="requiredInvalid(\'请选择一个签约银行\')" detect-change="off" detect-blur="off" initial="off" v-validate:bank_code="[\'required\']" v-bind:value="bank_code" v-model="bank_code" class="form-control" style="padding:0px;"><option v-for="bank in banks" value="{{bank.code}}">{{bank.name}}</option></select></div>
        template:'<div class="pop-panel" v-bind:class="{\'show\':this.show}"><div class="pop-box"><div class="pop-title">{{title}}<a class="win_close_btn" @click="close()"><i class="fa fa-fw fa-close"></i></a></div><div class="pop-content"><validator name="validatorMethod"><form role="form"><div class="box-body"><div class="form-group"><label>支付方式</label><div class="btn-row"style="overflow:hidden;font-size:12px"><a @click="select_bank(item)" v-bind:class="{\'active\':this.sel_bank.code==item.code}" v-if="item!=-1"  v-for="item in banks">{{item.name}}</a></div></div><div class="form-group"><label for="money">入金金额</label><input type="number" min="0" id="money" @invalid="requiredInvalid(\'金额填写不正确\')" detect-change="off" detect-blur="off" initial="off" v-model="money" class="form-control" v-validate:money="{required:true,min:0}"></div></div><div class="box-footer"><button type="button" class="btn btn-info btn-sm" style="width:120px;float:left;" @click="save()">{{button}}</button><button type="button" class="btn  btn-default btn-sm" style="width:120px;float:left;margin-left:15px;" @click="close()">取消</button></div></form></validator></div></div><div class="bg"></div></div>',
        data: function () {
            return {
                show: !1,
                title:'机构入金',
                button:'确认入金',
                showError:null,
                money: 0,
                sel_bank:{"name":"支付宝扫码支付", "value":"ALIPAY_h5", "type":"zito"},
                banks:[
                    {"name":"支付宝扫码支付", "value":"ALIPAY_h5", "type":"zito"},
                ]
            }
        },
        events: {
            'openOrganizationRechargeWin': function () {
                var i = this;
                i.data_init();
            },
        },
        methods: {
            data_init: function () {
                this.showError = [], this.show = !0;
            },
            requiredInvalid:function (msg) {
                var t = this;
                t.showError.push(msg);
            },
            save: function() {
                var t = this;
                t.$validate(true,function () {
                    if(!t.$validatorMethod.invalid) {
                        t.close();
                        if (t.money > 0) {
                            // +"&bankCode="+t.bank_code
                            // window.open(root+"/organization/smallAmountRecharge?money="+t.money);

                            var index = layer.load(0, {shade:[0.3, '#000000']}); //0代表加载的风格，支持0-2
                            postMsg(root+"/organization/smallAmountRecharge", {money:t.money, pbank:t.sel_bank.value, type:t.sel_bank.type}, function(i) {
                                layer.close(index);
                                if (i.code == -1) {
                                    window.location.reload();
                                } else {
                                    if (i.code == 1) {
										t.$dispatch("scanCodeWin", {type:i.url_type, bind: i.src});
                                    } else {
                                        layer.alert(i.msg);
                                    }
                                }
                            });

                        }
                        /*var index = layer.load(0, {shade:[0.3, '#000000']}); //0代表加载的风格，支持0-2
                        postMsg(root+"/user/capital_adjuste", t.user, function(i) {
                            layer.close(index);
                            layer.alert(i.msg);
                            if (i.code == 0) {
                                t.show = !1;
                                var key = "balance";
                                t.$dispatch("refreshUser", {key:key,value:i.money});
                            }
                        });*/
                    } else {
                        layer.alert(t.showError[(t.showError.length-1)], {end:function () {
                            t.showError = [];
                        }});
                    }
                });
            },
            close: function () {
                var t = this;
                t.show = !1;
            }
        }
    })
},  function (t, i) {
    Vue.component("pop-scan-code-component", {
        template:'<div class="pop-panel" v-bind:class="{\'show\':this.show}"><div class="pop-box" style="width:300px;"><div class="pop-title">{{title}}<a class="win_close_btn" @click="close()"><i class="fa fa-fw fa-close"></i></a></div><div class="pop-content"><img src="{{src}}" style="width:300px;"></div><div class="box-footer"><button type="button" class="btn btn-info btn-sm" style="width:120px;float:left;" @click="close()">已成功支付</button><button type="button" class="btn  btn-default btn-sm" style="width:120px;float:left;margin-left:15px;" @click="close()">支付遇到问题？</button></div></div><div class="bg"></div></div>',
        data: function () {
            return {
                show: !1,
                title:'扫码支付',
                src:''
            }
        },
        events: {
            'openScanCodeWin': function (obj) {
                var i = this;
                i.data_init(obj);
            },
        },
        methods: {
            data_init: function (obj) {
                if (obj.type == 'src') {
                    this.src = obj.bind;
                } else {
                    this.src= root+"/organization/q_scan?codeUrl=" + obj.bind;
                }

                this.show = !0;
            },
            close: function () {
                var t = this;
                t.show = !1;
            }
        }
    })
}]);